//#include<iostream>
//
//using namespace std;
//int main()
//{
//	int a, b;
//	while (cin >> a >> b)
//	{
//		cout << a + b << endl;
//	}
//	return 0;
//}



#define _CRT_SECURE_NO_WARNINGS 1
#include<cstring>
#include<iostream>
using namespace std;

void checklen(char* big, int& big_len, char* sml, int& sml_len, char** arr)
{
	arr[0] = big;
	arr[1] = sml;
	if (big_len < sml_len)
	{
		static char tmp[1001];
		strcpy(tmp, big);
		strcpy(big, sml);
		strcpy(sml, tmp);
		int tmp1 = big_len;
		big_len = sml_len;
		sml_len = tmp1;
	}
}

void sum(char* ret,char* big,int big_len, char* sml, int sml_len)
{
	int top = 0;
	int sml_end = sml_len - 1, big_end = big_len - 1;
	while (sml_end >= 0)
	{
		int all = big[big_end] + sml[sml_end] + top - 2 * '0';
		if (all >= 10)
			top = 1;
		ret[big_end] = all % 10 + '0';
		--big_end;--sml_end;
	}
	while (big_end >= 0)
	{

		ret[big_end] = (big[big_end]-'0' + top) % 10 + '0';
		big_end--;
		if (!(big[big_end] + 1 - '0' >= 10))
		{
			top = 0;
			break;
		}
	}
	if (top == 1)
	{
		char tp[1004] = "1";
		strcpy(ret,strcat(tp, ret));
	}

}

int main()
{
	char bstr[1001] = { 0 };
	char sstr[1001] = { 0 };
	char* tmp[2];
	int T = 0;
	scanf("%d", &T);
	for (int i = 0;i < T;++i)
	{
		cin >> bstr >> sstr;
		int big_len = strlen(bstr), sml_len = strlen(sstr);
		cout << "Case " << i + 1 << ":" << endl;
		checklen(bstr,big_len, sstr, sml_len, tmp);
		char ret[1004] = { 0 };
		sum(ret,bstr, big_len, sstr, sml_len);
		cout << tmp[0] << " + " << tmp[1] << " = " ;
		printf("%s\n\n", ret);
	}
	return 0;
}


